#! /bin/sh

pattern="$1"
shift
envs="`tox --listenvs-all | grep -F $pattern | grep -v 'noauto\|w32' | sed 's/$/,/'`"

if [ -n "$envs" ]; then
   exec tox -e "$envs" "$@"
else
   echo "No environments match $pattern" >&2
   exit 1
fi
